Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
contentPostList.repliessolved.tooltip
Replied In
NetworkFramework how to attempt to connect to a local address when there's not WAN connection?
Without closing the old one like this?func startTimeoutClock(on con: NWConnection) {
DispatchQueue.main.async {
self.retryTimer?.invalidate()
self.retryTimer = Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { timer in
if con.state == .preparing, con.currentPath?.usesInterfaceType(.wifi) != nil, let alternative = self.alternativeEndpoint {
self.debug("Connection timeout on \(con.endpoint), trying alternative endpoint \(alternative)")
_ = self.create(alternative)
}
}
}
}
}When it comes to bestPathUpdateHandler am I handling it correctly? Couldn't find any examples on how to use it